﻿using CleanArchitecture.Infrastructure.Entities.Settings;
using CleanArchitecture.Web.Factories;
using Microsoft.AspNetCore.Mvc;
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace CleanArchitecture.Web.Controllers.Backend
{
    public partial class BackendLoginController : BaseController
    {
        private readonly IAdminUserModelFactory _adminUserModelFactory;
        private readonly SecuritySettings _securitySettings;
        

        public BackendLoginController(IAdminUserModelFactory adminusermodelFact,
            SecuritySettings securitySettings)
        {
            this._adminUserModelFactory = adminusermodelFact;
            this._securitySettings = securitySettings;
        }
        // GET: /<controller>/
        //[HttpsRequirement(SslRequirement.Yes)]
        public IActionResult Index()
        {
            var model = _adminUserModelFactory.PrepareLoginModel();
            model.CustomProperties.Add(nameof(_securitySettings.BackendLoginVerifyType), _securitySettings.BackendLoginVerifyType);
            return View(model);
        }
    }
}
